package sdk.webview.fmc.com.fmcsdk.activity;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.net.http.SslError;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.webkit.SslErrorHandler;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.annotation.Nullable;

import sdk.webview.fmc.com.fmcsdk.BuildConfig;
import sdk.webview.fmc.com.fmcsdk.R;
import sdk.webview.fmc.com.fmcsdk.base.BasePresenter;
import sdk.webview.fmc.com.fmcsdk.h5.JsInterface;
import sdk.webview.fmc.com.fmcsdk.util.Constant;
import sdk.webview.fmc.com.fmcsdk.util.StringUtils;
import sdk.webview.fmc.com.fmcsdk.util.ToastUtils;
import sdk.webview.fmc.com.fmcsdk.util.Utility;
import sdk.webview.fmc.com.fmcsdk.util.XLog;

public class CommonWebActivity extends Activity {

    private WebView webView;
    private ImageView iv_back;
    private TextView tv_title;

    @Override

    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_common_web);
        webView = (WebView) findViewById(R.id.webview);
        iv_back = (ImageView) findViewById(R.id.iv_back);
        tv_title = (TextView) findViewById(R.id.tv_title);
        iv_back.setVisibility(View.VISIBLE);
        tv_title.setVisibility(View.VISIBLE);
        iv_back.setOnClickListener(new View.OnClickListener() {
                                       @Override
                                       public void onClick(View view) {
                                           finish();
                                       }
                                   }
        );

        WebSettings webSettings = webView.getSettings();
//        webSettings.setDefaultFontSize(16); // 设置字体大小为20像素
        webSettings.setTextZoom(100);// 设置字体大小为原始大小的50%

        tv_title.setText(getResources().getString(R.string.user_privacy_agreement_title));
        webView.loadUrl(StringUtils.getActivityPlaceholders(this, "YINSI_XIEYI_URL"));
    }

}
